﻿<%@ Page Title="File Upload" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="FileUpload.aspx.cs" Inherits="ColorApplication._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <img src="images/headerbullet.jpg" width="29" height="31" hspace="0" vspace="0" align="left" />
    <asp:Label ID="lblHeading" runat="server" CssClass="subheading"></asp:Label>
    <asp:Label ID="lblSelected" runat="server" Text="You selected these attribute families - <b><u> {0}</u></b>."
        class="bestPicture" Visible="false" Style="background: none repeat scroll 0 0 #FFEAA8;
        border-radius: 7px 7px 7px 7px; color: #826200; float: right; margin: 0;" />
    <div class="text" style="margin-top: 16px; margin-bottom: 17%;" id="divMainContainForUpload">
        <table cellpadding="0" cellspacing="0" style="width: 100%">
            <tr>
                <td colspan="2" align="center">
                    <div id="modalPage" runat="server" class="modalPage">
                        <div class="modalBackground">
                        </div>
                        <div class="modalContainer" align="center">
                            <div class="modal">
                                <table>
                                    <tr>
                                        <td align="center">
                                            <%--Change by hanumant--%>
                                            <div style="background-color: White; border: 2px solid #541C65; color: #723684; height: 47px;
                                                padding: 15px 10px 10px; text-transform: uppercase; overflow: hidden; display: block;">
                                                Please Wait...
                                                <br />
                                                <img style="margin-top: 6px;" src="Images/preloader.gif" />
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <asp:Label ID="lblPageError" runat="server" CssClass="failureNotification"></asp:Label>
                </td>
            </tr>
            <tr id="trUpload" runat="server">
                <td colspan="2" style="background-color: #f8f8f8; border: 1px solid #e6e6e6; padding: 10px 42px 0">
                    <table style="width: 100%" id="tbUploads" runat="server">
                        <tr>
                            <td style="vertical-align: top; width: 50%;">
                                <table id="tbFileupload1" runat="server" width="100%">
                                    <tr>
                                        <td colspan="2">
                                            <label>
                                                <asp:Literal ID="litFirstImg" Text="First Image:" runat="server" />
                                            </label>
                                            <p>
                                                <asp:Label ID="ErrorLabel" runat="server" CssClass="failureNotification"></asp:Label>
                                                <asp:Label ID="SuccesLabel" runat="server" CssClass="successNotification"></asp:Label>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:FileUpload ID="FileUpload1" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:RegularExpressionValidator ID="FileRegularExpressionValidator1" ValidationGroup="mygroup"
                                                runat="server" ControlToValidate="FileUpload1" CssClass="failureNotification"
                                                Display="Dynamic" ErrorMessage="Invalid Image File." ValidationExpression="(.*?)\.(jpg|jpeg|png|gif|bmp|JPG|JPEG|PNG|GIF|BMP)$"> </asp:RegularExpressionValidator>
                                            <div style="margin-right: -335px; text-align: right;">
                                                <asp:CustomValidator ID="CustomValidator1" ValidationGroup="mygroup" runat="server"
                                                    ControlToValidate="FileUpload1" CssClass="failureNotification" Display="Dynamic"
                                                    ValidateEmptyText="True"></asp:CustomValidator>
                                                <asp:CustomValidator ID="CustomValidator2" ValidationGroup="mygroup" runat="server"
                                                    ErrorMessage="A File is Required." ControlToValidate="FileUpload1" CssClass="failureNotification"
                                                    Display="Dynamic" ClientValidationFunction="validateRequired" ValidateEmptyText="True"
                                                    Style="margin-right: 170px;"></asp:CustomValidator>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="vertical-align: top; width: 50%;">
                                <table style="float: right;" id="tbFileupload2" runat="server" width="100%">
                                    <tr>
                                        <td>
                                            <label>
                                                Second Image:</label>
                                            <p>
                                                <asp:Label ID="ErrorLabel2" runat="server" CssClass="failureNotification"></asp:Label>
                                                <asp:Label ID="SuccesLabel2" runat="server" CssClass="successNotification"></asp:Label>
                                            </p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:FileUpload ID="FileUpload2" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:RegularExpressionValidator ID="FileRegularExpressionValidator2" ValidationGroup="mygroup"
                                                runat="server" ControlToValidate="FileUpload2" CssClass="failureNotification"
                                                Display="Dynamic" ErrorMessage="Invalid Image File." ValidationExpression="(.*?)\.(jpg|jpeg|png|gif|bmp|JPG|JPEG|PNG|GIF|BMP)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right;">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td id="TDForResultSaveButton" runat="server" style="vertical-align: top;" align="center"
                                colspan="2">
                                <asp:Button ID="SaveButton" runat="server" Text="Show Results" ValidationGroup="mygroup"
                                    CssClass="btnShow bigFont" OnClick="SaveButton_Click" OnClientClick="document.getElementById('form1').target ='_self';" />
                            </td>
                        </tr>
                    </table>
                    <table id="tbUrl" runat="server" style="width: 100%">
                        <tr>
                            <td style="padding-bottom: 11px">
                                <asp:Panel runat="server" DefaultButton="SaveButton1">
                                    <asp:TextBox ID="txtUrl" runat="server" Style="width: 300px; margin-right: 40px;" />
                                    <asp:TextBoxWatermarkExtender runat="server" Enabled="True" TargetControlID="txtUrl"
                                        ID="txtUrl_TextBoxWatermarkExtender" WatermarkCssClass="waterMark" WatermarkText="Enter web site URL eg. http://www.colorsay.com">
                                    </asp:TextBoxWatermarkExtender>
                                    <asp:Button ID="SaveButton1" runat="server" Text="Show Results" ValidationGroup="urlgroup"
                                        CssClass="btnShow bigFont" OnClick="SaveButton1_Click " OnClientClick="document.getElementById('form1').target ='_self';PreloadPage();" />
                                    <asp:CustomValidator ID="CustomValidatorForUrl" ValidationGroup="urlgroup" runat="server"
                                                    ControlToValidate="txtUrl" CssClass="failureNotification" Display="Dynamic"
                                                    ValidateEmptyText="True"></asp:CustomValidator>
                                    <asp:RequiredFieldValidator ErrorMessage="Required" ID="UrlRequerd" ControlToValidate="txtUrl"
                                        CssClass="failureNotification" Display="Dynamic" runat="server" ValidationGroup="urlgroup" />
                                    
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr id="trAfterUpload" runat="server" style="display: none;">
                <td colspan="2">
                    <asp:Panel ID="pnlImg1" runat="server" CssClass="divImg1MainSingle bigFont">
                        <p class="p headMsg ">
                            <asp:Label ID="LabelImageName" runat="server" Style="text-transform: uppercase; word-break: break-all;"></asp:Label>
                        </p>
                        <div id="divImgMain1" runat="server" class="imgMainDivSingle">
                            <div id="divImg1" runat="server" class="imgImgDivSingle">
                                <asp:Image ID="Image1" runat="server" CssClass="imgImg" />
                            </div>
                            <div id="divImgSize1" runat="server" class="imgImgSizeSingle">
                                <label>
                                    Image size:</label>
                                &nbsp;<label id="lblImgSize1" runat="server">256 kb</label>
                            </div>
                            <div id="trBtn" runat="server" class="imgBtnDivSingle">
                                <asp:Button ID="DownloadButton" Style="float: left;" runat="server" Text="Download XLS"
                                    OnClick="DownloadButton_Click" OnClientClick="document.getElementById('form1').target ='_self';"
                                    CssClass="btnShow bigFont" />
                                <asp:Button ID="WebFileButton" runat="server" Text="Download Web File" OnClick="WebFileButton_Click"
                                    OnClientClick="document.getElementById('form1').target ='_self';" CssClass="btnShow bigFont" />
                                <asp:Button ID="ViewHtmlButton" runat="server" Text="View HTML" OnClick="ViewHtmlButton_Click"
                                    OnClientClick="document.getElementById('form1').target ='_blank';" CssClass="btnShow bigFont" />
                            </div>
                            <div id="divContribute1" runat="server" style="float: left;">
                                <asp:Label ID="lblContributeColor1" Text="The color which contributed most to good direction is {0}"
                                    runat="server" />
                                <asp:Label ID="lblWhiteNeuMessage" runat="server" Text="White color neutralization is not activated."
                                    Style="display: none;"></asp:Label>
                            </div>
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="pnlImg2" runat="server" CssClass="divImg1MainSingle bigFont">
                        <p class="p headMsg ">
                            <asp:Label ID="LabelImageName2" runat="server" Style="text-transform: uppercase;"></asp:Label>
                        </p>
                        <div id="divImgMain2" runat="server" class="imgMainDivSingle">
                            <div id="divImg2" runat="server" class="imgImgDivSingle">
                                <asp:Image ID="Image2" runat="server" CssClass="imgImg" />
                            </div>
                            <div id="divImgSize2" runat="server" class="imgImgSizeSingle">
                                <label>
                                    Image size:
                                </label>
                                &nbsp;<label id="lblImgSize2" runat="server">256 kb</label>
                            </div>
                            <div id="trBtn2" runat="server" class="imgBtnDivSingle">
                                <asp:Button ID="DownloadButton2" Style="float: left;" runat="server" Text="Download XLS"
                                    OnClick="DownloadButton2_Click" OnClientClick="document.getElementById('form1').target ='_self';"
                                    CssClass="btnShow bigFont" />
                                <asp:Button ID="WebFileButton2" runat="server" Text="Download Web File" OnClick="WebFileButton2_Click"
                                    OnClientClick="document.getElementById('form1').target ='_self';" CssClass="btnShow bigFont" />
                                <asp:Button ID="ViewHtmlButton2" runat="server" Text="View HTML" OnClick="ViewHtmlButton2_Click"
                                    OnClientClick="document.getElementById('form1').target ='_blank';" CssClass="btnShow bigFont" />
                            </div>
                            <div id="divContribute2" runat="server" style="float: left;">
                                <asp:Label ID="lblContributeColor2" Text="The color which contributed most to good direction is {0}"
                                    runat="server" />
                                <asp:Label ID="lblWhiteNeuMessage2" runat="server" Text="White color neutralization is not activated."
                                    Style="display: none;"></asp:Label>
                            </div>
                        </div>
                    </asp:Panel>
                </td>
            </tr>
            <tr id="trAttributes" runat="server" style="display: none;">
                <td colspan="2" style="padding: 20px 0;">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td align="center">
                                <p class="p headMsg bigFont">
                                    <asp:Label runat="server" ID="lblChooseAttrsMessage">Please choose up to {0} desired attributes{1}</asp:Label>
                                </p>
                                <p class="p pHead bigFont">
                                    Attribute Family
                                </p>
                                <asp:GridView ID="grdVwAttribute" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                    Width="100%" ShowHeader="False" CellPadding="4" ForeColor="#333333" GridLines="None"
                                    CssClass="bigFont grd">
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chk" runat="server" />
                                            </ItemTemplate>
                                            <ItemStyle Width="5%" HorizontalAlign="Right" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                                            SortExpression="Id" Visible="False" />
                                        <asp:TemplateField HeaderText="Attribute Family" SortExpression="description">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# Bind("Description") %>' ID="lblAttributeFamily"
                                                    AssociatedControlID="chk"></asp:Label>
                                                <asp:HiddenField runat="server" ID="hfViewAttribute" Value='<%# Eval("Id") %>'/>
                                            </ItemTemplate>
                                            <ItemStyle Width="50%" HorizontalAlign="Left" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:DropDownList ID="ddlAppearance" runat="server" Style="background-color: #E1E1E1;
                                                    border: 1px solid #B6B6B6; width: 90%;">
                                                    <asp:ListItem Text="should appear" Value="1" />
                                                    <asp:ListItem Text="important to appear" Value="2" />
                                                </asp:DropDownList>
                                            </ItemTemplate>
                                            <ItemStyle Width="45%" HorizontalAlign="Left" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <RowStyle VerticalAlign="Top" BackColor="#EEEEEE" Height="40px" />
                                    <AlternatingRowStyle BackColor="#F8F8F8" Height="40px" />
                                </asp:GridView>
                                <asp:SqlDataSource ID="AttributeFamiliesGridSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                    SelectCommand="GetSearchByAttributesfamiliesSelect" SelectCommandType="StoredProcedure"
                                    CancelSelectOnNullParameter="False"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center">
                    <asp:Label ID="BestPicture0" runat="server" Text="Picture {0} is better." class="bestPicture"
                        Visible="false" />
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top; padding-top: 20px;" colspan="2">
                    <asp:Panel ID="Panel1" runat="server" Style="float: left; overflow: auto; width: 100%;">
                        <div id="tabDiv" name="tabDiv">
                            <asp:TabContainer ID="TabContainer1" runat="server" Width="100%" ActiveTabIndex="4"
                                Style="" CssClass="Tab">
                                <asp:TabPanel runat="server" ID="CSVTabPanel" HeaderText="CSV File" ForeColor="Black">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ShowFileGridView" runat="server" AllowSorting="True" OnSorting="ShowFileGridView_Sorting"
                                                AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:BoundField DataField="Sub-color name" HeaderText="Sub-color name" ReadOnly="True"
                                                        SortExpression="Sub-color name" />
                                                    <asp:BoundField DataField="R value" HeaderText="R value" ReadOnly="True" SortExpression="R value" />
                                                    <asp:BoundField DataField="G value" HeaderText="G value" ReadOnly="True" SortExpression="G value" />
                                                    <asp:BoundField DataField="B value" HeaderText="B value" ReadOnly="True" SortExpression="B value" />
                                                    <asp:BoundField DataField="Pixels amount" HeaderText="Pixels amount" ReadOnly="True"
                                                        SortExpression="Pixels amount" />
                                                    <asp:BoundField DataField="Pixels pecentage" HeaderText="Pixels pecentage" ReadOnly="True"
                                                        SortExpression="Pixels pecentage" />
                                                    <asp:BoundField DataField="Column 11" HeaderText="Brightness" ReadOnly="True" SortExpression="Column 11" />
                                                </Columns>
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorTabPanel" Visible="False" HeaderText="Color Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorGridView" Width="100%" runat="server" AllowSorting="True"
                                                OnSorting="ColorGridView_Sorting" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Color" SortExpression="Color">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblColor" runat="server" Text='<%# Bind("Color") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Percentage" SortExpression="Percentage">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPercentage" runat="server" Text='<%# Bind("Percentage") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                            <asp:Label ID="LabelContributedColor" runat="server"><font style="color: red; font-weight: bold;">*</font> : The color which contributed most to good direction.</asp:Label>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="SubColorTabPanel" Visible="False" HeaderText="Sub-Color Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="SubColorDeatilsGridView" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="SubColorDeatilsGridView_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorBrightnessTabPanel" Visible="False" HeaderText="Color Brightness">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorBrightNessGridView" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="ColorBrightNessGridView_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorAttributeTabPanel" Visible="false" HeaderText="Attribute Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorAttributeGridView" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="ColorAttributeGridView_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="AttributeFamiliesPanel" HeaderText="Attribute Families Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:Repeater ID="AttributeFamiliesGridView" runat="server" OnItemDataBound="AttributeFamiliesGridView_ItemDataBound">
                                                <HeaderTemplate>
                                                    <table cellpadding="0" cellspacing="0" style="width: 100%; font-family: Arial;">
                                                        <tr>
                                                            <th class="th thStart">
                                                                Attribute Families
                                                            </th>
                                                            <th class="th thMiddle">
                                                                Attribute
                                                            </th>
                                                            <th class="th thMiddle" id="AttributeCountHeader" runat="server">
                                                                Count
                                                            </th>
                                                            <th class="th thMiddle" id="AttributePercentageHeader" runat="server">
                                                                Percentage
                                                            </th>
                                                            <th class="th thEnd">
                                                                Weighted (%)
                                                            </th>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="background-color: #DFEBF7; color: #118BCB; font-size: 13px;
                                                                font-weight: bold; padding: 5px;" colspan="5">
                                                                Most Dominant Types
                                                            </td>
                                                        </tr>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <tr class="trItem">
                                                        <td class="tdStart">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute Families")%>
                                                        </td>
                                                        <td class="tdMiddle">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributeCount" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Count")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributePercentage" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Percentage")%>
                                                        </td>
                                                        <td class="tdEnd">
                                                            <%#DataBinder.Eval(Container.DataItem, "WeightedPercentage")%>
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace1" runat="server" visible="False">
                                                        <td id="Td1" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace2" runat="server" visible="False">
                                                        <td id="Td2" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                </ItemTemplate>
                                                <AlternatingItemTemplate>
                                                    <tr class="trAlterItem">
                                                        <td class="tdStart">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute Families")%>
                                                        </td>
                                                        <td class="tdMiddle">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributeCount" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Count")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributePercentage" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Percentage")%>
                                                        </td>
                                                        <td class="tdEnd">
                                                            <%#DataBinder.Eval(Container.DataItem, "WeightedPercentage")%>
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace1" runat="server" visible="False">
                                                        <td id="Td1" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace2" runat="server" visible="False">
                                                        <td id="Td2" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                </AlternatingItemTemplate>
                                                <FooterTemplate>
                                                    </table>
                                                </FooterTemplate>
                                            </asp:Repeater>
                                            <asp:Label ID="lblWantedFamilyMark" runat="server" />
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="WhiteColorNeutralizationPanel" HeaderText="White Color Neutralization"
                                    Visible="false">
                                    <HeaderTemplate>
                                        White Color Neutralization
                                    </HeaderTemplate>
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="WhiteColorNeutralizationGridView" Width="100%" runat="server">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="BrightnessLevelPanel" HeaderText="Brightness Level"
                                    Visible="false">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="BrightnesLevelGridView" Width="100%" runat="server">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                            </asp:TabContainer>
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="Panel2" runat="server" Style="float: left; overflow: auto; width: 100%;">
                        <div id="tabDiv" name="tabDiv">
                            <asp:TabContainer ID="TabContainer2" runat="server" Width="100%" ActiveTabIndex="0"
                                Style="" CssClass="Tab">
                                <asp:TabPanel runat="server" ID="CSVTabPanel2" HeaderText="CSV File" ForeColor="Black">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ShowFileGridView2" runat="server" AllowSorting="True" OnSorting="ShowFileGridView2_Sorting"
                                                AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:BoundField DataField="Sub-color name" HeaderText="Sub-color name" ReadOnly="True"
                                                        SortExpression="Sub-color name" />
                                                    <asp:BoundField DataField="R value" HeaderText="R value" ReadOnly="True" SortExpression="R value" />
                                                    <asp:BoundField DataField="G value" HeaderText="G value" ReadOnly="True" SortExpression="G value" />
                                                    <asp:BoundField DataField="B value" HeaderText="B value" ReadOnly="True" SortExpression="B value" />
                                                    <asp:BoundField DataField="Pixels amount" HeaderText="Pixels amount" ReadOnly="True"
                                                        SortExpression="Pixels amount" />
                                                    <asp:BoundField DataField="Pixels pecentage" HeaderText="Pixels pecentage" ReadOnly="True"
                                                        SortExpression="Pixels pecentage" />
                                                    <asp:BoundField DataField="Column 11" HeaderText="Brightness" ReadOnly="True" SortExpression="Column 11" />
                                                </Columns>
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorTabPanel2" Visible="False" HeaderText="Color Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorGridView2" Width="100%" runat="server" AllowSorting="True"
                                                OnSorting="ColorGridView2_Sorting" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Color" SortExpression="Color">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblColor" runat="server" Text='<%# Bind("Color") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Percentage" SortExpression="Percentage">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPercentage" runat="server" Text='<%# Bind("Percentage") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                            <asp:Label ID="LabelContributedColor2" runat="server"><font style="color: red; font-weight: bold;">*</font> : The color which contributed most to good direction.</asp:Label>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="SubColorTabPanel2" Visible="False" HeaderText="Sub-Color
                        Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="SubColorDeatilsGridView2" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="SubColorDeatilsGridView2_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorBrightnessTabPanel2" Visible="False" HeaderText="Color Brightness">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorBrightNessGridView2" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="ColorBrightNessGridView2_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="ColorAttributeTabPanel2" Visible="false" HeaderText="Attribute
                        Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="ColorAttributeGridView2" Width="100%" runat="server" AllowSorting="true"
                                                OnSorting="ColorAttributeGridView2_Sorting">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="AttributeFamiliesPanel2" HeaderText="Attribute
                        Families Details">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:Repeater ID="AttributeFamiliesGridView2" runat="server" OnItemDataBound="AttributeFamiliesGridView2_ItemDataBound">
                                                <HeaderTemplate>
                                                    <table cellpadding="0" cellspacing="0" style="width: 100%; font-family: Arial;">
                                                        <tr>
                                                            <th class="th thStart">
                                                                Attribute Families
                                                            </th>
                                                            <th class="th thMiddle">
                                                                Attribute
                                                            </th>
                                                            <th class="th thMiddle" id="AttributeCountHeader" runat="server">
                                                                Count
                                                            </th>
                                                            <th class="th thMiddle" id="AttributePercentageHeader" runat="server">
                                                                Percentage
                                                            </th>
                                                            <th class="th thEnd">
                                                                Weighted (%)
                                                            </th>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="background-color: #DFEBF7; color: #118BCB; font-size: 13px;
                                                                font-weight: bold; padding: 5px;" colspan="5">
                                                                Most Dominant Types
                                                            </td>
                                                        </tr>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <tr class="trItem">
                                                        <td class="tdStart">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute Families")%>
                                                        </td>
                                                        <td class="tdMiddle">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributeCount" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Count")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributePercentage" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Percentage")%>
                                                        </td>
                                                        <td class="tdEnd">
                                                            <%#DataBinder.Eval(Container.DataItem, "WeightedPercentage")%>
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace1" runat="server" visible="False">
                                                        <td id="Td1" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace2" runat="server" visible="False">
                                                        <td id="Td2" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                </ItemTemplate>
                                                <AlternatingItemTemplate>
                                                    <tr class="trAlterItem">
                                                        <td class="tdStart">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute Families")%>
                                                        </td>
                                                        <td class="tdMiddle">
                                                            <%#DataBinder.Eval(Container.DataItem, "Attribute")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributeCount" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Count")%>
                                                        </td>
                                                        <td class="tdMiddle" id="AttributePercentage" runat="server">
                                                            <%#DataBinder.Eval(Container.DataItem, "Percentage")%>
                                                        </td>
                                                        <td class="tdEnd">
                                                            <%#DataBinder.Eval(Container.DataItem, "WeightedPercentage")%>
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace1" runat="server" visible="False">
                                                        <td id="Td1" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                    <tr id="trSpace2" runat="server" visible="False">
                                                        <td id="Td2" colspan="5" class="tdSpace" runat="server">
                                                            <br />
                                                        </td>
                                                    </tr>
                                                </AlternatingItemTemplate>
                                                <FooterTemplate>
                                                    </table></FooterTemplate>
                                            </asp:Repeater>
                                            <asp:Label ID="lblWantedFamilyMark2" runat="server" />
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="WhiteColorNeutralizationPanel2" HeaderText="White Color Neutralization"
                                    Visible="false">
                                    <HeaderTemplate>
                                        White Color Neutralization</HeaderTemplate>
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="WhiteColorNeutralizationGridView2" Width="100%" runat="server">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                                <asp:TabPanel runat="server" ID="BrightnessLevelPanel2" HeaderText="Brightness Level"
                                    Visible="false">
                                    <ContentTemplate>
                                        <div style="overflow: auto; color: Black;">
                                            <asp:GridView ID="BrightnesLevelGridView2" Width="100%" runat="server">
                                                <HeaderStyle Font-Bold="False" ForeColor="Black" />
                                            </asp:GridView>
                                        </div>
                                    </ContentTemplate>
                                </asp:TabPanel>
                            </asp:TabContainer>
                        </div>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top; padding-top: 20px;" colspan="2">
                    <asp:Panel ID="pnlPieImg1" runat="server" Style="text-align: center; padding: 10px 0;
                        display: none;">
                        <asp:Image ID="imgPieChart1" alt="Pie Chart" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlPieImg2" runat="server" Style="text-align: center; padding: 10px 0;
                        display: none;">
                        <asp:Image ID="imgPieChart2" alt="Pie Chart" runat="server" />
                    </asp:Panel>
                    <asp:Button ID="btnViewDetail" Text="View Detail" runat="server" Visible="false"
                        OnClick="btnViewDetail_Click" Style="float: right;" CssClass="btnShow bigFont" />
                    <div style="clear: both; font-size: 16px; font-weight: bolder; text-align: center;">
                        <asp:Label ID="lblCommonMessage" runat="server" />
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center">
                    <asp:Label ID="BestPicture" runat="server" Text="Picture {0} is better." class="bestPicture"
                        Visible="false" />
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        function toggleSelect1() {
            var ErrorLabel = $get('<%=ErrorLabel.ClientID%>');
            var SuccesLabel = $get('<%=SuccesLabel.ClientID %>');
            var Image1 = $get('<%=Image1.ClientID %>');
            var Panel1 = document.getElementsByName('tabDiv');
            var trBtn = $get('<%=trBtn.ClientID %>');
            var LabelImageName = $get('<%= LabelImageName.ClientID%>');
            var lblWhiteNeuMessage = $get('<%= lblWhiteNeuMessage.ClientID %>');
            var trAttributes = $get('<%= trAttributes.ClientID %>');

            var ErrorLabel2 = $get('<%=ErrorLabel2.ClientID%>');
            var SuccesLabel2 = $get('<%=SuccesLabel2.ClientID %>');
            var Image2 = $get('<%=Image2.ClientID %>');
            var trBtn2 = $get('<%=trBtn2.ClientID %>');
            var LabelImageName2 = $get('<%= LabelImageName2.ClientID%>');
            var lblWhiteNeuMessage2 = $get('<%= lblWhiteNeuMessage2.ClientID %>');

            trBtn2.style.display = 'none';
            ErrorLabel2.style.display = 'none';
            SuccesLabel2.style.display = 'none';
            Image2.style.display = 'none';
            LabelImageName2.style.display = 'none';
            lblWhiteNeuMessage2.style.display = 'none';

            trBtn.style.display = 'none';
            trAttributes.style.display = '';
            ErrorLabel.style.display = 'none';
            SuccesLabel.style.display = 'none';
            Image1.style.display = 'none';
            Panel1[0].style.display = 'none';
            Panel1[1].style.display = 'none';
            LabelImageName.style.display = 'none';
            lblWhiteNeuMessage.style.display = 'none';
        }

        function toggleSelect2() {
            var ErrorLabel = $get('<%=ErrorLabel2.ClientID%>');
            var SuccesLabel = $get('<%=SuccesLabel2.ClientID %>');
            var Image1 = $get('<%=Image2.ClientID %>');
            var Panel2 = $get('<%=Panel2.ClientID %>');
            var trBtn = $get('<%=trBtn2.ClientID %>');
            var LabelImageName = $get('<%= LabelImageName2.ClientID%>');
            var lblWhiteNeuMessage = $get('<%= lblWhiteNeuMessage2.ClientID %>');

            trBtn.style.display = 'none';
            ErrorLabel.style.display = 'none';
            SuccesLabel.style.display = 'none';
            Image1.style.display = 'none';
            Panel2.style.display = 'none';
            LabelImageName.style.display = 'none';
            lblWhiteNeuMessage.style.display = 'none';
        }
        function PreloadPage() { //DOM
            if (document.getElementById) {
                var modalPage = document.getElementById('<%= modalPage.ClientID %>');
                var FileUpload1 = document.getElementById('<%= FileUpload1.ClientID %>');
                var FileRegularExpressionValidator1 = document.getElementById('<%= FileRegularExpressionValidator1.ClientID %>');
                var CustomValidator1 = document.getElementById('<%= CustomValidator1.ClientID %>');
                var CustomValidator2 = document.getElementById('<%= CustomValidator2.ClientID %>');
                var FileRegularExpressionValidator2 = document.getElementById('<%= FileRegularExpressionValidator2.ClientID %>');
                var UrlTextbox = document.getElementById('<%= txtUrl.ClientID %>');
                var UrlrequiredValidator = document.getElementById('<%= UrlRequerd.ClientID %>');
                var UrlCustomValidator = document.getElementById('<%= CustomValidatorForUrl.ClientID %>');

                ValidatorEnable(CustomValidator2, true);
                ValidatorEnable(FileRegularExpressionValidator1, true);
                ValidatorEnable(FileRegularExpressionValidator2, true);
                ValidatorEnable(CustomValidator1, true);
                
                ValidatorEnable(UrlrequiredValidator, true);
                ValidatorEnable(UrlCustomValidator, true);

                if (modalPage != null) {
                    if (FileUpload1.value != '' && FileRegularExpressionValidator1.style.display != 'inline' && FileRegularExpressionValidator2.style.display != 'inline' && CustomValidator1.style.display != 'inline' && CustomValidator2.style.display != 'inline') {
                        modalPage.style.visibility = 'visible';
                    }

                    if (UrlTextbox.value == '' || UrlTextbox.value == "Enter web site URL eg. http://www.colorsay.com") {
                        modalPage.style.display = 'none';
                        return false;
                    }

                    var cssValueOfCustomValidator = $("#MainContent_CustomValidatorForUrl").css("display");
                    var cssValueOfRequiredVal = $("#MainContent_UrlRequerd").css("display");
                    if (cssValueOfCustomValidator == "inline" || cssValueOfRequiredVal == "inline") {
                        modalPage.style.display = 'none';
                        return false;
                    } else {
                        modalPage.style.visibility = 'visible';
                    }
                }
            }
        };
    </script>
</asp:Content>
